package com.company.bookstore.mapper.cart_module;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.company.bookstore.entities.cart_module.Cart;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 江洪锦
 * @since 2020-09-18
 */
public interface CartMapper extends BaseMapper<Cart> {

    /**
     * 返回最后一行cart.id
     */
    @Select("SELECT    id\n" +
            "FROM      cart\n" +
            "ORDER BY  id DESC\n" +
            "LIMIT     1;\n")
    int getLastCartId();
}
